#ifndef PHONELOGINWIDGET_H
#define PHONELOGINWIDGET_H

#include <QWidget>
#include <QLineEdit>
#include <QTimer>
#include <QPushButton>
#include <QLabel>

class PhoneLoginWidget : public QWidget
{
    Q_OBJECT
public:
    explicit PhoneLoginWidget(QWidget *parent = nullptr);
    void sendVerifyCode();
    void sendVerifyCodeDone();
    void clickSubmitBtn();
    void counDown();
    void phoneLoginDone(bool ok, const QString& reason);
    void phoneRegisterDone(bool ok, const QString& reason);
    void switchMode();

private:
    bool isLoginMode = true;
    //记录使用哪个手机号发送验证码

    QString currentPhone = "";
    QLineEdit* phoneEdit;
    QPushButton* sendVerifyCodeBtn;

    QLineEdit* verifyCodeEdit;

    //定时器
    QTimer* timer;
    int leftTime = 30;
    QLabel* titleLabel;
    QPushButton* submitBtn;
    QPushButton* switchModeBtn;

signals:
};

#endif // PHONELOGINWIDGET_H
